home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 …ember: Reference Library / Apple Developer Reference Library (December 1999) (Disk 1).iso / pc / technical documentation / develop / develop issue 24 / develop issue 24 code / new device drivers / PCI Driver Sample / NCR_DriverProject / Src / GetDeviceLogicalAddress.c < prev    next >
MacBinary  |  1995-07-24  |  5.3 KB  |  [TEXT/MPCC]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Mon Jul 24 17:34:43 1995, modified Mon Jul 24 17:34:43 1995, creator 'MPCC', type ASCII, 4694 bytes "GetDeviceLogicalAddress.c" , at 0x12d6 410 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPCC]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 19 47 65 74 44 65 76 | 69 63 65 4c 6f 67 69 63 |..GetDev|iceLogic|
|00000010| 61 6c 41 64 64 72 65 73 | 73 2e 63 00 00 00 00 00 |alAddres|s.c.....|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 43 | 43 01 00 00 00 00 00 00 |.TEXTMPC|C.......|
|00000050| 00 00 00 00 00 12 56 00 | 00 01 9a ac 39 c2 73 ac |......V.|....9.s.|
|00000060| 39 c2 73 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |9.s.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 98 56 00 00 |........|.....V..|
|00000080| 2f 2a 09 09 09 09 09 09 | 09 09 47 65 74 44 65 76 |/*......|..GetDev|
|00000090| 69 63 65 4c 6f 67 69 63 | 61 6c 41 64 64 72 65 73 |iceLogic|alAddres|
|000000a0| 73 2e 63 09 09 09 09 09 | 09 09 2a 2f 0d 2f 2a 0d |s.c.....|..*/./*.|
|000000b0| 20 2a 20 47 65 74 44 65 | 76 69 63 65 4c 6f 67 69 | * GetDe|viceLogi|
|000000c0| 63 61 6c 41 64 64 72 65 | 73 73 2e 63 0d 20 2a 20 |calAddre|ss.c. * |
|000000d0| 43 6f 70 79 72 69 67 68 | 74 20 a9 20 31 39 39 34 |Copyrigh|t . 1994|
|000000e0| 2d 39 35 20 41 70 70 6c | 65 20 43 6f 6d 70 75 74 |-95 Appl|e Comput|
|000000f0| 65 72 20 49 6e 63 2e 20 | 41 6c 6c 20 72 69 67 68 |er Inc. |All righ|
|00000100| 74 73 20 72 65 73 65 72 | 76 65 64 2e 0d 20 2a 0d |ts reser|ved.. *.|
|00000110| 20 2a 2f 0d 2f 2a 09 2e | 5f 5f 5f 5f 5f 5f 5f 5f | */./*..|________|
|00000120| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000130| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000140| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000150| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000160| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 2e 0d 20 20 09 |________|___.. .|
|00000170| 7c 20 54 68 69 73 20 64 | 65 76 69 63 65 20 72 65 || This d|evice re|
|00000180| 74 72 69 65 76 65 73 20 | 74 68 65 20 4c 6f 67 69 |trieves |the Logi|
|00000190| 63 61 6c 41 64 64 72 65 | 73 73 20 61 6e 64 20 6c |calAddre|ss and l|
|000001a0| 65 6e 67 74 68 20 6f 66 | 20 61 20 50 43 49 20 64 |ength of| a PCI d|
|000001b0| 65 76 69 63 65 20 22 72 | 65 67 69 73 74 65 72 22 |evice "r|egister"|
|000001c0| 09 7c 0d 20 20 09 7c 20 | 49 74 20 69 73 20 69 6e |.|. .| |It is in|
|000001d0| 64 65 70 65 6e 64 65 6e | 74 20 6f 66 20 74 68 65 |dependen|t of the|
|000001e0| 20 46 72 61 6d 65 77 6f | 72 6b 20 64 72 69 76 65 | Framewo|rk drive|
|000001f0| 72 2e 20 54 68 69 73 20 | 66 75 6e 63 74 69 6f 6e |r. This |function|
|00000200| 20 6d 61 79 20 6f 6e 6c | 79 20 62 65 20 63 61 6c | may onl|y be cal|
|00000210| 6c 65 64 09 09 7c 0d 20 | 20 09 7c 20 66 72 6f 6d |led..|. | .| from|
|00000220| 20 74 68 65 20 64 72 69 | 76 65 72 20 69 6e 69 74 | the dri|ver init|
|00000230| 69 61 6c 69 7a 61 74 69 | 6f 6e 20 66 75 6e 63 74 |ializati|on funct|
|00000240| 69 6f 6e 73 2e 09 09 09 | 09 09 09 09 09 09 09 09 |ions....|........|
|00000250| 7c 0d 20 20 09 7c 20 54 | 68 69 73 20 6d 61 79 20 ||. .| T|his may |
|00000260| 6e 65 65 64 20 65 78 74 | 65 6e 73 69 6f 6e 20 66 |need ext|ension f|
|00000270| 6f 72 20 63 65 72 74 61 | 69 6e 20 68 61 72 64 77 |or certa|in hardw|
|00000280| 61 72 65 20 63 6f 6e 66 | 69 67 75 72 61 74 69 6f |are conf|iguratio|
|00000290| 6e 73 2e 09 09 09 09 09 | 09 7c 0d 09 2e 5f 5f 5f |ns......|.|...___|
|000002a0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000002b0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000002c0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000002d0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000002e0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000002f0| 2e 0d 2a 2f 0d 2f 2a 0d | 20 2a 20 52 65 76 69 73 |..*/./*.| * Revis|
|00000300| 65 64 20 39 35 2e 30 34 | 2e 30 37 20 74 6f 20 75 |ed 95.04|.07 to u|
|00000310| 73 65 20 74 68 65 20 64 | 65 66 69 6e 69 74 69 6f |se the d|efinitio|
|00000320| 6e 73 20 69 6e 20 50 43 | 49 2e 68 0d 20 2a 2f 0d |ns in PC|I.h. */.|
|00000330| 23 69 6e 63 6c 75 64 65 | 20 22 4e 43 52 44 72 69 |#include| "NCRDri|
|00000340| 76 65 72 50 72 69 76 61 | 74 65 2e 68 22 20 0d 0d |verPriva|te.h" ..|
|00000350| 0d 2f 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |./* * * |* * * * |
|00000360| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|00000370| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|00000380| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|00000390| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|000003a0| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 0d 20 2a 20 47 |* * * * |* *. * G|
|000003b0| 65 74 44 65 76 69 63 65 | 4c 6f 67 69 63 61 6c 41 |etDevice|LogicalA|
|000003c0| 64 64 72 65 73 73 0d 20 | 2a 0d 20 2a 20 52 65 74 |ddress. |*. * Ret|
|000003d0| 72 69 65 76 65 20 74 68 | 65 20 61 73 73 69 67 6e |rieve th|e assign|
|000003e0| 65 64 2d 61 64 64 72 65 | 73 73 20 70 72 6f 70 65 |ed-addre|ss prope|
|000003f0| 72 74 79 20 66 72 6f 6d | 20 74 68 65 20 4e 61 6d |rty from| the Nam|
|00000400| 65 20 52 65 67 69 73 74 | 72 79 20 61 6e 64 20 73 |e Regist|ry and s|
|00000410| 65 61 72 63 68 20 69 74 | 20 66 6f 72 0d 20 2a 20 |earch it| for. * |
|00000420| 74 68 65 20 73 70 65 63 | 69 66 69 65 64 20 61 64 |the spec|ified ad|
|00000430| 64 72 65 73 73 53 70 61 | 63 65 53 65 6c 65 63 74 |dressSpa|ceSelect|
|00000440| 6f 72 2e 20 54 68 69 73 | 20 66 75 6e 63 74 69 6f |or. This| functio|
|00000450| 6e 20 75 73 65 73 20 74 | 68 65 20 64 65 76 69 63 |n uses t|he devic|
|00000460| 65 20 62 61 73 65 20 72 | 65 67 69 73 74 65 72 0d |e base r|egister.|
|00000470| 20 2a 20 6f 6e 6c 79 3a | 20 69 74 20 69 67 6e 6f | * only:| it igno|
|00000480| 72 65 73 20 74 68 65 20 | 49 2f 4f 20 76 73 2e 20 |res the |I/O vs. |
|00000490| 4d 65 6d 6f 72 79 20 73 | 70 61 63 65 20 73 65 6c |Memory s|pace sel|
|000004a0| 65 63 74 6f 72 2e 20 49 | 74 20 77 69 6c 6c 20 6e |ector. I|t will n|
|000004b0| 65 65 64 20 6d 6f 64 69 | 66 69 63 61 74 69 6f 6e |eed modi|fication|
|000004c0| 20 69 66 0d 20 2a 20 74 | 68 65 20 68 61 72 64 77 | if. * t|he hardw|
|000004d0| 61 72 65 20 73 75 70 70 | 6f 72 74 73 20 36 34 2d |are supp|orts 64-|
|000004e0| 62 69 74 20 61 64 64 72 | 65 73 73 69 6e 67 20 6f |bit addr|essing o|
|000004f0| 72 20 6e 65 65 64 73 20 | 74 6f 20 75 6e 64 65 72 |r needs |to under|
|00000500| 73 74 61 6e 64 20 61 64 | 64 72 65 73 73 20 73 70 |stand ad|dress sp|
|00000510| 61 63 65 73 2e 0d 20 2a | 2f 0d 4f 53 45 72 72 0d |aces.. *|/.OSErr.|
|00000520| 47 65 74 44 65 76 69 63 | 65 4c 6f 67 69 63 61 6c |GetDevic|eLogical|
|00000530| 41 64 64 72 65 73 73 28 | 0d 09 09 52 65 67 45 6e |Address(|...RegEn|
|00000540| 74 72 79 49 44 50 74 72 | 09 09 09 72 65 67 45 6e |tryIDPtr|...regEn|
|00000550| 74 72 79 49 44 50 74 72 | 2c 09 09 09 2f 2a 20 44 |tryIDPtr|,.../* D|
|00000560| 72 69 76 65 72 27 73 20 | 4e 61 6d 65 20 52 65 67 |river's |Name Reg|
|00000570| 69 73 74 65 72 79 20 49 | 44 09 2a 2f 0d 09 09 50 |istery I|D.*/...P|
|00000580| 43 49 52 65 67 69 73 74 | 65 72 4e 75 6d 62 65 72 |CIRegist|erNumber|
|00000590| 09 09 64 65 76 69 63 65 | 52 65 67 69 73 74 65 72 |..device|Register|
|000005a0| 2c 09 09 09 2f 2a 20 52 | 65 67 69 73 74 65 72 20 |,.../* R|egister |
|000005b0| 69 6e 20 61 64 64 72 65 | 73 73 20 70 72 6f 70 65 |in addre|ss prope|
|000005c0| 72 74 79 09 2a 2f 0d 09 | 09 4c 6f 67 69 63 61 6c |rty.*/..|.Logical|
|000005d0| 41 64 64 72 65 73 73 09 | 09 09 2a 64 65 76 69 63 |Address.|..*devic|
|000005e0| 65 4c 6f 67 69 63 61 6c | 41 64 64 72 65 73 73 2c |eLogical|Address,|
|000005f0| 09 2f 2a 20 47 65 74 73 | 20 74 68 65 20 6c 6f 67 |./* Gets| the log|
|00000600| 69 63 61 6c 20 61 64 64 | 72 65 73 73 09 09 2a 2f |ical add|ress..*/|
|00000610| 0d 09 09 42 79 74 65 43 | 6f 75 6e 74 09 09 09 09 |...ByteC|ount....|
|00000620| 2a 64 65 76 69 63 65 41 | 72 65 61 4c 65 6e 67 74 |*deviceA|reaLengt|
|00000630| 68 09 09 2f 2a 20 47 65 | 74 73 20 74 68 65 20 61 |h../* Ge|ts the a|
|00000640| 72 65 61 20 73 69 7a 65 | 09 09 09 2a 2f 0d 09 29 |rea size|...*/..)|
|00000650| 0d 7b 0d 09 09 4f 53 45 | 72 72 09 09 09 09 09 73 |.{...OSE|rr.....s|
|00000660| 74 61 74 75 73 3b 0d 09 | 09 73 68 6f 72 74 09 09 |tatus;..|.short..|
|00000670| 09 09 09 69 3b 09 09 09 | 09 09 09 2f 2a 20 56 65 |...i;...|.../* Ve|
|00000680| 63 74 6f 72 20 69 6e 64 | 65 78 09 09 09 09 09 2a |ctor ind|ex.....*|
|00000690| 2f 0d 09 09 73 68 6f 72 | 74 09 09 09 09 09 6e 41 |/...shor|t.....nA|
|000006a0| 64 64 72 65 73 73 65 73 | 3b 09 09 09 09 2f 2a 20 |ddresses|;..../* |
|000006b0| 4e 75 6d 62 65 72 20 6f | 66 20 76 65 63 74 6f 72 |Number o|f vector|
|000006c0| 20 65 6c 65 6d 65 6e 74 | 73 09 2a 2f 0d 09 09 52 | element|s.*/...R|
|000006d0| 65 67 50 72 6f 70 65 72 | 74 79 56 61 6c 75 65 53 |egProper|tyValueS|
|000006e0| 69 7a 65 09 61 73 73 69 | 67 6e 65 64 41 64 64 72 |ize.assi|gnedAddr|
|000006f0| 65 73 73 53 69 7a 65 3b | 0d 09 09 52 65 67 50 72 |essSize;|...RegPr|
|00000700| 6f 70 65 72 74 79 56 61 | 6c 75 65 53 69 7a 65 09 |opertyVa|lueSize.|
|00000710| 6c 6f 67 69 63 61 6c 41 | 64 64 72 65 73 73 53 69 |logicalA|ddressSi|
|00000720| 7a 65 3b 0d 09 09 52 65 | 67 50 72 6f 70 65 72 74 |ze;...Re|gPropert|
|00000730| 79 56 61 6c 75 65 09 09 | 2a 61 73 73 69 67 6e 65 |yValue..|*assigne|
|00000740| 64 41 64 64 72 65 73 73 | 50 72 6f 70 65 72 74 79 |dAddress|Property|
|00000750| 3b 20 2f 2a 20 41 73 73 | 69 67 6e 65 64 20 41 64 |; /* Ass|igned Ad|
|00000760| 64 72 65 73 73 20 70 72 | 6f 70 65 72 74 79 09 2a |dress pr|operty.*|
|00000770| 2f 0d 09 09 50 43 49 41 | 73 73 69 67 6e 65 64 41 |/...PCIA|ssignedA|
|00000780| 64 64 72 65 73 73 50 74 | 72 09 70 63 69 41 73 73 |ddressPt|r.pciAss|
|00000790| 69 67 6e 65 64 41 64 64 | 72 65 73 73 50 74 72 3b |ignedAdd|ressPtr;|
|000007a0| 09 2f 2a 20 41 73 73 69 | 67 6e 65 64 20 41 64 64 |./* Assi|gned Add|
|000007b0| 72 65 73 73 20 65 6c 65 | 6d 65 6e 74 20 70 74 72 |ress ele|ment ptr|
|000007c0| 09 2a 2f 0d 09 09 4c 6f | 67 69 63 61 6c 41 64 64 |.*/...Lo|gicalAdd|
|000007d0| 72 65 73 73 09 09 09 2a | 6c 6f 67 69 63 61 6c 41 |ress...*|logicalA|
|000007e0| 64 64 72 65 73 73 56 65 | 63 74 6f 72 3b 09 2f 2a |ddressVe|ctor;./*|
|000007f0| 20 41 41 50 4c 2c 61 64 | 64 72 65 73 73 65 73 20 | AAPL,ad|dresses |
|00000800| 70 72 6f 70 65 72 74 79 | 09 09 2a 2f 0d 09 09 53 |property|..*/...S|
|00000810| 74 72 69 6e 67 50 74 72 | 09 09 09 09 66 61 69 6c |tringPtr|....fail|
|00000820| 75 72 65 4d 73 67 3b 0d | 09 09 0d 09 09 54 72 61 |ureMsg;.|.....Tra|
|00000830| 63 65 28 47 65 74 44 65 | 76 69 63 65 4c 6f 67 69 |ce(GetDe|viceLogi|
|00000840| 63 61 6c 41 64 64 72 65 | 73 73 29 3b 0d 09 09 66 |calAddre|ss);...f|
|00000850| 61 69 6c 75 72 65 4d 73 | 67 20 3d 20 4e 55 4c 4c |ailureMs|g = NULL|
|00000860| 3b 0d 09 09 61 73 73 69 | 67 6e 65 64 41 64 64 72 |;...assi|gnedAddr|
|00000870| 65 73 73 50 72 6f 70 65 | 72 74 79 20 3d 20 4e 55 |essPrope|rty = NU|
|00000880| 4c 4c 3b 0d 09 09 6c 6f | 67 69 63 61 6c 41 64 64 |LL;...lo|gicalAdd|
|00000890| 72 65 73 73 56 65 63 74 | 6f 72 20 3d 20 4e 55 4c |ressVect|or = NUL|
|000008a0| 4c 3b 0d 09 09 69 66 20 | 28 64 65 76 69 63 65 4c |L;...if |(deviceL|
|000008b0| 6f 67 69 63 61 6c 41 64 | 64 72 65 73 73 20 3d 3d |ogicalAd|dress ==|
|000008c0| 20 4e 55 4c 4c 20 7c 7c | 20 64 65 76 69 63 65 41 | NULL ||| deviceA|
|000008d0| 72 65 61 4c 65 6e 67 74 | 68 20 3d 3d 20 4e 55 4c |reaLengt|h == NUL|
|000008e0| 4c 29 0d 09 09 09 73 74 | 61 74 75 73 20 3d 20 70 |L)....st|atus = p|
|000008f0| 61 72 61 6d 45 72 72 3b | 0d 09 09 65 6c 73 65 20 |aramErr;|...else |
|00000900| 7b 0d 09 09 09 2f 2a 0d | 09 09 09 20 2a 20 46 65 |{..../*.|... * Fe|
|00000910| 74 63 68 20 74 68 65 20 | 61 73 73 69 67 6e 65 64 |tch the |assigned|
|00000920| 20 61 64 64 72 65 73 73 | 20 61 6e 64 20 41 41 50 | address| and AAP|
|00000930| 4c 2c 61 64 64 72 65 73 | 73 20 70 72 6f 70 65 72 |L,addres|s proper|
|00000940| 74 69 65 73 2e 20 41 6c | 6c 6f 63 61 74 65 20 6d |ties. Al|locate m|
|00000950| 65 6d 6f 72 79 0d 09 09 | 09 20 2a 20 66 6f 72 20 |emory...|. * for |
|00000960| 65 61 63 68 2e 0d 09 09 | 09 20 2a 2f 0d 09 09 09 |each....|. */....|
|00000970| 73 74 61 74 75 73 20 3d | 20 47 65 74 54 68 69 73 |status =| GetThis|
|00000980| 50 72 6f 70 65 72 74 79 | 28 0d 09 09 09 09 09 09 |Property|(.......|
|00000990| 72 65 67 45 6e 74 72 79 | 49 44 50 74 72 2c 0d 09 |regEntry|IDPtr,..|
|000009a0| 09 09 09 09 09 6b 50 43 | 49 41 73 73 69 67 6e 65 |.....kPC|IAssigne|
|000009b0| 64 41 64 64 72 65 73 73 | 50 72 6f 70 65 72 74 79 |dAddress|Property|
|000009c0| 2c 0d 09 09 09 09 09 09 | 26 61 73 73 69 67 6e 65 |,.......|&assigne|
|000009d0| 64 41 64 64 72 65 73 73 | 50 72 6f 70 65 72 74 79 |dAddress|Property|
|000009e0| 2c 0d 09 09 09 09 09 09 | 26 61 73 73 69 67 6e 65 |,.......|&assigne|
|000009f0| 64 41 64 64 72 65 73 73 | 53 69 7a 65 0d 09 09 09 |dAddress|Size....|
|00000a00| 09 09 29 3b 0d 09 09 09 | 43 68 65 63 6b 53 74 61 |..);....|CheckSta|
|00000a10| 74 75 73 28 73 74 61 74 | 75 73 2c 20 22 5c 70 4e |tus(stat|us, "\pN|
|00000a20| 6f 20 61 73 73 69 67 6e | 65 64 2d 61 64 64 72 65 |o assign|ed-addre|
|00000a30| 73 73 65 73 20 70 72 6f | 70 65 72 74 79 22 29 3b |sses pro|perty");|
|00000a40| 0d 09 09 09 69 66 20 28 | 73 74 61 74 75 73 20 21 |....if (|status !|
|00000a50| 3d 20 6e 6f 45 72 72 29 | 0d 09 09 09 09 66 61 69 |= noErr)|.....fai|
|00000a60| 6c 75 72 65 4d 73 67 20 | 3d 20 22 5c 70 4e 6f 20 |lureMsg |= "\pNo |
|00000a70| 22 20 6b 50 43 49 41 73 | 73 69 67 6e 65 64 41 64 |" kPCIAs|signedAd|
|00000a80| 64 72 65 73 73 50 72 6f | 70 65 72 74 79 20 22 20 |dressPro|perty " |
|00000a90| 70 72 6f 70 65 72 74 79 | 22 3b 0d 09 09 7d 0d 09 |property|";...}..|
|00000aa0| 09 69 66 20 28 73 74 61 | 74 75 73 20 3d 3d 20 6e |.if (sta|tus == n|
|00000ab0| 6f 45 72 72 29 20 7b 0d | 09 09 09 73 74 61 74 75 |oErr) {.|...statu|
|00000ac0| 73 20 3d 20 47 65 74 54 | 68 69 73 50 72 6f 70 65 |s = GetT|hisPrope|
|00000ad0| 72 74 79 28 0d 09 09 09 | 09 09 09 72 65 67 45 6e |rty(....|...regEn|
|00000ae0| 74 72 79 49 44 50 74 72 | 2c 0d 09 09 09 09 09 09 |tryIDPtr|,.......|
|00000af0| 6b 41 41 50 4c 44 65 76 | 69 63 65 4c 6f 67 69 63 |kAAPLDev|iceLogic|
|00000b00| 61 6c 41 64 64 72 65 73 | 73 2c 0d 09 09 09 09 09 |alAddres|s,......|
|00000b10| 09 28 52 65 67 50 72 6f | 70 65 72 74 79 56 61 6c |.(RegPro|pertyVal|
|00000b20| 75 65 20 2a 29 20 26 6c | 6f 67 69 63 61 6c 41 64 |ue *) &l|ogicalAd|
|00000b30| 64 72 65 73 73 56 65 63 | 74 6f 72 2c 0d 09 09 09 |dressVec|tor,....|
|00000b40| 09 09 09 26 6c 6f 67 69 | 63 61 6c 41 64 64 72 65 |...&logi|calAddre|
|00000b50| 73 73 53 69 7a 65 0d 09 | 09 09 09 09 29 3b 0d 09 |ssSize..|....);..|
|00000b60| 09 09 43 68 65 63 6b 53 | 74 61 74 75 73 28 73 74 |..CheckS|tatus(st|
|00000b70| 61 74 75 73 2c 20 22 5c | 70 4e 6f 20 41 41 50 4c |atus, "\|pNo AAPL|
|00000b80| 2c 61 64 64 72 65 73 73 | 20 70 72 6f 70 65 72 74 |,address| propert|
|00000b90| 79 22 29 3b 0d 09 09 09 | 69 66 20 28 73 74 61 74 |y");....|if (stat|
|00000ba0| 75 73 20 21 3d 20 6e 6f | 45 72 72 29 0d 09 09 09 |us != no|Err)....|
|00000bb0| 09 66 61 69 6c 75 72 65 | 4d 73 67 20 3d 20 22 5c |.failure|Msg = "\|
|00000bc0| 70 4e 6f 20 22 20 6b 41 | 41 50 4c 44 65 76 69 63 |pNo " kA|APLDevic|
|00000bd0| 65 4c 6f 67 69 63 61 6c | 41 64 64 72 65 73 73 20 |eLogical|Address |
|00000be0| 20 22 20 70 72 6f 70 65 | 72 74 79 22 3b 0d 09 09 | " prope|rty";...|
|00000bf0| 7d 0d 09 09 69 66 20 28 | 73 74 61 74 75 73 20 3d |}...if (|status =|
|00000c00| 3d 20 6e 6f 45 72 72 29 | 20 7b 0d 09 09 09 73 74 |= noErr)| {....st|
|00000c10| 61 74 75 73 20 3d 20 70 | 61 72 61 6d 45 72 72 3b |atus = p|aramErr;|
|00000c20| 0d 09 09 09 6e 41 64 64 | 72 65 73 73 65 73 20 3d |....nAdd|resses =|
|00000c30| 20 61 73 73 69 67 6e 65 | 64 41 64 64 72 65 73 73 | assigne|dAddress|
|00000c40| 53 69 7a 65 20 2f 20 73 | 69 7a 65 6f 66 20 28 50 |Size / s|izeof (P|
|00000c50| 43 49 41 73 73 69 67 6e | 65 64 41 64 64 72 65 73 |CIAssign|edAddres|
|00000c60| 73 29 3b 0d 09 09 09 70 | 63 69 41 73 73 69 67 6e |s);....p|ciAssign|
|00000c70| 65 64 41 64 64 72 65 73 | 73 50 74 72 20 3d 20 28 |edAddres|sPtr = (|
|00000c80| 50 43 49 41 73 73 69 67 | 6e 65 64 41 64 64 72 65 |PCIAssig|nedAddre|
|00000c90| 73 73 50 74 72 29 20 61 | 73 73 69 67 6e 65 64 41 |ssPtr) a|ssignedA|
|00000ca0| 64 64 72 65 73 73 50 72 | 6f 70 65 72 74 79 3b 0d |ddressPr|operty;.|
|00000cb0| 09 09 09 66 6f 72 20 28 | 69 20 3d 20 30 3b 20 69 |...for (|i = 0; i|
|00000cc0| 20 3c 20 6e 41 64 64 72 | 65 73 73 65 73 3b 20 69 | < nAddr|esses; i|
|00000cd0| 2b 2b 2c 20 70 63 69 41 | 73 73 69 67 6e 65 64 41 |++, pciA|ssignedA|
|00000ce0| 64 64 72 65 73 73 50 74 | 72 2b 2b 29 20 7b 0d 09 |ddressPt|r++) {..|
|00000cf0| 09 09 09 69 66 20 28 47 | 65 74 50 43 49 52 65 67 |...if (G|etPCIReg|
|00000d00| 69 73 74 65 72 4e 75 6d | 62 65 72 28 70 63 69 41 |isterNum|ber(pciA|
|00000d10| 73 73 69 67 6e 65 64 41 | 64 64 72 65 73 73 50 74 |ssignedA|ddressPt|
|00000d20| 72 29 20 3d 3d 20 64 65 | 76 69 63 65 52 65 67 69 |r) == de|viceRegi|
|00000d30| 73 74 65 72 29 20 7b 0d | 09 09 09 09 09 69 66 20 |ster) {.|.....if |
|00000d40| 28 70 63 69 41 73 73 69 | 67 6e 65 64 41 64 64 72 |(pciAssi|gnedAddr|
|00000d50| 65 73 73 50 74 72 2d 3e | 73 69 7a 65 2e 68 69 20 |essPtr->|size.hi |
|00000d60| 21 3d 20 30 09 09 09 2f | 2a 20 36 34 2d 62 69 74 |!= 0.../|* 64-bit|
|00000d70| 20 61 72 65 61 3f 09 09 | 2a 2f 0d 09 09 09 09 09 | area?..|*/......|
|00000d80| 20 7c 7c 20 70 63 69 41 | 73 73 69 67 6e 65 64 41 | || pciA|ssignedA|
|00000d90| 64 64 72 65 73 73 50 74 | 72 2d 3e 73 69 7a 65 2e |ddressPt|r->size.|
|00000da0| 6c 6f 20 3d 3d 20 30 29 | 20 7b 09 09 2f 2a 20 5a |lo == 0)| {../* Z|
|00000db0| 65 72 6f 20 6c 65 6e 67 | 74 68 09 09 2a 2f 0d 09 |ero leng|th..*/..|
|00000dc0| 09 09 09 09 09 2f 2a 0d | 09 09 09 09 09 09 20 2a |...../*.|...... *|
|00000dd0| 20 4f 70 65 6e 20 46 69 | 72 6d 77 61 72 65 20 77 | Open Fi|rmware w|
|00000de0| 61 73 20 75 6e 61 62 6c | 65 20 74 6f 20 61 73 73 |as unabl|e to ass|
|00000df0| 69 67 6e 20 61 20 76 61 | 6c 69 64 20 61 64 64 72 |ign a va|lid addr|
|00000e00| 65 73 73 20 74 6f 20 74 | 68 69 73 0d 09 09 09 09 |ess to t|his.....|
|00000e10| 09 09 20 2a 20 6d 65 6d | 6f 72 79 20 61 72 65 61 |.. * mem|ory area|
|00000e20| 2e 20 57 65 20 6d 75 73 | 74 20 72 65 74 75 72 6e |. We mus|t return|
|00000e30| 20 61 6e 20 65 72 72 6f | 72 20 74 6f 20 70 72 65 | an erro|r to pre|
|00000e40| 76 65 6e 74 20 74 68 65 | 20 64 72 69 76 65 72 0d |vent the| driver.|
|00000e50| 09 09 09 09 09 09 20 2a | 20 66 72 6f 6d 20 73 74 |...... *| from st|
|00000e60| 61 72 74 69 6e 67 20 75 | 70 2e 20 49 73 20 74 68 |arting u|p. Is th|
|00000e70| 65 72 65 20 61 20 62 65 | 74 74 65 72 20 65 72 72 |ere a be|tter err|
|00000e80| 6f 72 20 73 74 61 74 75 | 73 3f 0d 09 09 09 09 09 |or statu|s?......|
|00000e90| 09 20 2a 2f 0d 09 09 09 | 09 09 09 73 74 61 74 75 |. */....|...statu|
|00000ea0| 73 20 3d 20 70 61 72 61 | 6d 45 72 72 3b 0d 09 09 |s = para|mErr;...|
|00000eb0| 09 09 09 09 66 61 69 6c | 75 72 65 4d 73 67 20 3d |....fail|ureMsg =|
|00000ec0| 20 22 5c 70 42 61 64 20 | 61 73 73 69 67 6e 65 64 | "\pBad |assigned|
|00000ed0| 20 61 64 64 72 65 73 73 | 20 73 69 7a 65 22 3b 0d | address| size";.|
|00000ee0| 09 09 09 09 09 09 4c 6f | 67 48 65 78 28 0d 09 09 |......Lo|gHex(...|
|00000ef0| 09 09 09 09 09 70 63 69 | 41 73 73 69 67 6e 65 64 |.....pci|Assigned|
|00000f00| 41 64 64 72 65 73 73 50 | 74 72 2d 3e 73 69 7a 65 |AddressP|tr->size|
|00000f10| 2e 68 69 2c 0d 09 09 09 | 09 09 09 09 22 5c 70 70 |.hi,....|...."\pp|
|00000f20| 63 69 41 73 73 69 67 6e | 65 64 41 64 64 72 65 73 |ciAssign|edAddres|
|00000f30| 73 50 74 72 2d 3e 73 69 | 7a 65 2e 68 69 22 0d 09 |sPtr->si|ze.hi"..|
|00000f40| 09 09 09 09 09 29 3b 0d | 09 09 09 09 09 09 4c 6f |.....);.|......Lo|
|00000f50| 67 48 65 78 28 0d 09 09 | 09 09 09 09 09 70 63 69 |gHex(...|.....pci|
|00000f60| 41 73 73 69 67 6e 65 64 | 41 64 64 72 65 73 73 50 |Assigned|AddressP|
|00000f70| 74 72 2d 3e 73 69 7a 65 | 2e 6c 6f 2c 0d 09 09 09 |tr->size|.lo,....|
|00000f80| 09 09 09 09 22 5c 70 70 | 63 69 41 73 73 69 67 6e |...."\pp|ciAssign|
|00000f90| 65 64 41 64 64 72 65 73 | 73 50 74 72 2d 3e 73 69 |edAddres|sPtr->si|
|00000fa0| 7a 65 2e 6c 6f 22 0d 09 | 09 09 09 09 09 29 3b 0d |ze.lo"..|.....);.|
|00000fb0| 09 09 09 09 09 7d 0d 09 | 09 09 09 09 65 6c 73 65 |.....}..|....else|
|00000fc0| 20 69 66 20 28 69 20 3e | 3d 20 28 6c 6f 67 69 63 | if (i >|= (logic|
|00000fd0| 61 6c 41 64 64 72 65 73 | 73 53 69 7a 65 20 2f 20 |alAddres|sSize / |
|00000fe0| 73 69 7a 65 6f 66 20 28 | 4c 6f 67 69 63 61 6c 41 |sizeof (|LogicalA|
|00000ff0| 64 64 72 65 73 73 29 29 | 29 20 7b 0d 09 09 09 09 |ddress))|) {.....|
|00001000| 09 09 2f 2a 0d 09 09 09 | 09 09 09 20 2a 20 54 68 |../*....|... * Th|
|00001010| 65 20 6c 6f 67 69 63 61 | 6c 20 61 64 64 72 65 73 |e logica|l addres|
|00001020| 73 20 76 65 63 74 6f 72 | 20 69 73 20 74 6f 6f 20 |s vector| is too |
|00001030| 73 6d 61 6c 6c 20 2d 2d | 20 74 68 69 73 20 69 73 |small --| this is|
|00001040| 20 61 20 62 75 67 2e 0d | 09 09 09 09 09 09 20 2a | a bug..|...... *|
|00001050| 2f 0d 09 09 09 09 09 09 | 73 74 61 74 75 73 20 3d |/.......|status =|
|00001060| 20 70 61 72 61 6d 45 72 | 72 3b 0d 09 09 09 09 09 | paramEr|r;......|
|00001070| 09 66 61 69 6c 75 72 65 | 4d 73 67 20 3d 20 22 5c |.failure|Msg = "\|
|00001080| 70 4c 6f 67 69 63 61 6c | 20 61 64 64 72 65 73 73 |pLogical| address|
|00001090| 20 73 69 7a 65 20 3c 20 | 61 73 73 69 67 6e 65 64 | size < |assigned|
|000010a0| 20 61 64 64 72 65 73 73 | 20 73 69 7a 65 22 3b 20 | address| size"; |
|000010b0| 0d 09 09 09 09 09 7d 0d | 09 09 09 09 09 65 6c 73 |......}.|.....els|
|000010c0| 65 20 7b 0d 09 09 09 09 | 09 09 73 74 61 74 75 73 |e {.....|..status|
|000010d0| 20 3d 20 6e 6f 45 72 72 | 3b 0d 09 09 09 09 09 09 | = noErr|;.......|
|000010e0| 2a 64 65 76 69 63 65 4c | 6f 67 69 63 61 6c 41 64 |*deviceL|ogicalAd|
|000010f0| 64 72 65 73 73 20 3d 20 | 6c 6f 67 69 63 61 6c 41 |dress = |logicalA|
|00001100| 64 64 72 65 73 73 56 65 | 63 74 6f 72 5b 69 5d 3b |ddressVe|ctor[i];|
|00001110| 0d 09 09 09 09 09 09 2a | 64 65 76 69 63 65 41 72 |.......*|deviceAr|
|00001120| 65 61 4c 65 6e 67 74 68 | 20 3d 20 70 63 69 41 73 |eaLength| = pciAs|
|00001130| 73 69 67 6e 65 64 41 64 | 64 72 65 73 73 50 74 72 |signedAd|dressPtr|
|00001140| 2d 3e 73 69 7a 65 2e 6c | 6f 3b 0d 09 09 09 09 09 |->size.l|o;......|
|00001150| 7d 0d 09 09 09 09 09 62 | 72 65 61 6b 3b 20 2f 2a |}......b|reak; /*|
|00001160| 20 45 78 69 74 20 6c 6f | 6f 70 20 77 68 65 6e 20 | Exit lo|op when |
|00001170| 77 65 20 66 69 6e 64 20 | 74 68 65 20 64 65 73 69 |we find |the desi|
|00001180| 72 65 64 20 72 65 67 69 | 73 74 65 72 20 2a 2f 0d |red regi|ster */.|
|00001190| 09 09 09 09 7d 0d 09 09 | 09 7d 0d 09 09 09 43 68 |....}...|.}....Ch|
|000011a0| 65 63 6b 53 74 61 74 75 | 73 28 73 74 61 74 75 73 |eckStatu|s(status|
|000011b0| 2c 20 22 5c 70 4e 6f 20 | 76 61 6c 69 64 20 61 64 |, "\pNo |valid ad|
|000011c0| 64 72 65 73 73 20 73 70 | 61 63 65 22 29 3b 0d 09 |dress sp|ace");..|
|000011d0| 09 09 69 66 20 28 66 61 | 69 6c 75 72 65 4d 73 67 |..if (fa|ilureMsg|
|000011e0| 20 3d 3d 20 4e 55 4c 4c | 29 0d 09 09 09 09 66 61 | == NULL|).....fa|
|000011f0| 69 6c 75 72 65 4d 73 67 | 20 3d 20 22 5c 70 41 64 |ilureMsg| = "\pAd|
|00001200| 64 72 65 73 73 20 73 70 | 61 63 65 20 6e 6f 74 20 |dress sp|ace not |
|00001210| 66 6f 75 6e 64 22 3b 0d | 09 09 7d 0d 09 09 44 69 |found";.|..}...Di|
|00001220| 73 70 6f 73 65 54 68 69 | 73 50 72 6f 70 65 72 74 |sposeThi|sPropert|
|00001230| 79 28 26 61 73 73 69 67 | 6e 65 64 41 64 64 72 65 |y(&assig|nedAddre|
|00001240| 73 73 50 72 6f 70 65 72 | 74 79 29 3b 0d 09 09 44 |ssProper|ty);...D|
|00001250| 69 73 70 6f 73 65 54 68 | 69 73 50 72 6f 70 65 72 |isposeTh|isProper|
|00001260| 74 79 28 26 6c 6f 67 69 | 63 61 6c 41 64 64 72 65 |ty(&logi|calAddre|
|00001270| 73 73 56 65 63 74 6f 72 | 29 3b 0d 09 09 69 66 20 |ssVector|);...if |
|00001280| 28 73 74 61 74 75 73 20 | 21 3d 20 6e 6f 45 72 72 |(status |!= noErr|
|00001290| 29 0d 09 09 09 50 75 62 | 6c 69 73 68 49 6e 69 74 |)....Pub|lishInit|
|000012a0| 46 61 69 6c 75 72 65 4d | 73 67 28 73 74 61 74 75 |FailureM|sg(statu|
|000012b0| 73 2c 20 66 61 69 6c 75 | 72 65 4d 73 67 29 3b 0d |s, failu|reMsg);.|
|000012c0| 09 09 72 65 74 75 72 6e | 20 28 73 74 61 74 75 73 |..return| (status|
|000012d0| 29 3b 0d 7d 0d 0d 00 00 | 00 00 00 00 00 00 00 00 |);.}....|........|
|000012e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000012f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001300| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00001310| 00 00 03 00 16 0d 00 0a | 2a 24 1e 74 79 70 65 64 |........|*$.typed|
|00001320| 65 66 20 4b 65 72 6e 65 | 6c 49 44 20 45 76 65 6e |ef Kerne|lID Even|
|00001330| 19 47 65 74 44 65 76 69 | 63 65 4c 6f 67 69 63 61 |.GetDevi|ceLogica|
|00001340| 6c 41 64 64 72 65 73 73 | 2e 63 02 00 00 00 54 45 |lAddress|.c....TE|
|00001350| 00 00 54 45 58 54 4d 50 | 43 43 01 00 ff ff ff ff |..TEXTMP|CC......|
|00001360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001370| 00 00 ab 8f 16 b6 00 00 | 12 56 00 00 01 9a 74 69 |........|.V....ti|
|00001380| 6f 6e 20 61 6e 64 20 64 | 65 6c 65 74 69 6f 6e 20 |on and d|eletion |
|00001390| 6f 66 20 65 76 65 6e 74 | 20 66 6c 61 67 20 67 72 |of event| flag gr|
|000013a0| 6f 75 70 73 2c 20 6f 74 | 68 65 72 a0 00 97 a1 00 |oups, ot|her.....|
|000013b0| 96 00 06 01 00 00 00 00 | 00 2a 0c 58 6f 70 65 72 |........|.*.Xoper|
|000013c0| 61 74 69 6f 6e 73 20 61 | 6c 6c 6f 77 20 79 6f 75 |ations a|llow you|
|000013d0| 20 74 6f 20 53 65 74 2c | 20 43 6c 65 61 72 2c 20 | to Set,| Clear, |
|000013e0| 54 65 73 74 2c 20 61 6e | 64 20 57 61 69 74 20 66 |Test, an|d Wait f|
|000013f0| 6f 72 20 6f 6e 65 20 6f | 72 20 6d 6f 72 65 20 66 |or one o|r more f|
|00001400| 00 00 00 48 00 0a 43 6f | 75 72 69 65 72 00 00 00 |...H..Co|urier...|
|00001410| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001420| 00 00 00 00 00 00 00 03 | 00 04 00 7c 00 0e 02 75 |........|...|...u|
|00001430| 02 4e 00 7c 00 0e 02 75 | 02 4e ab fc f6 ff 00 00 |.N.|...u|.N......|
|00001440| 0c 6f 00 00 0c 6f 00 00 | 08 23 01 00 00 00 00 04 |.o...o..|.#......|
|00001450| 00 01 00 01 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|00001460| 00 00 00 46 00 c6 44 98 | 11 a2 00 00 00 1c 00 46 |...F..D.|.......F|
|00001470| 00 01 4d 50 53 52 00 00 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00001480| 00 1e 03 ed ff ff 00 00 | 00 00 00 00 00 00 03 f0 |........|........|
|00001490| ff ff 00 00 00 4c 00 00 | 00 00 00 00 00 00 00 00 |.....L..|........|
|000014a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000014f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+